public class Book {


            String name;
            int price;
            String author;
            int edition;

            public Book(String name, int price, String author, int edition) {
                this.name = name;
                this.price = price;
                this.author = author;
                this.edition = edition;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public int getPrice() {
                return price;
            }

            public void setPrice(int price) {
                this.price = price;
            }

            public String getAuthor() {
                return author;
            }

            public void setAuthor(String author) {
                this.author = author;
            }

            public int getEdition() {
                return edition;
            }

            public void setEdition(int edition) {
                this.edition = edition;
            }

            @Override
            public String toString() {
                return "name: " + this.name +
                        ", price: " + this.price +
                        ", author: " + this.author +
                        ", edition: " + this.edition;
            }

            @Override
            public boolean equals(Object o) {

                if (o == null) return false;
                else {
                    boolean result = false;
                    if (o instanceof Book) {
                        Book book = (Book) o;

                        if (book.name.equalsIgnoreCase(this.name)&&book.author.equalsIgnoreCase(this.author)&&book.edition==this.edition)
                            result = true;
                    }
                    return result;
                }
            }
        }



